package com.cdy.jxc_project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdy.jxc_project.domain.TMenu;
import com.cdy.jxc_project.mapper.TMenuMapper;
import com.cdy.jxc_project.service.TMenuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Project:jxc_project
 * @Author:cdy(缘生)
 * @Motto:放下杂念,只为迎接明天更好的自己
 * @Date:2023/4/21 11:27
 * */
@Service
@Transactional
public class TMenuServiceImpl extends ServiceImpl<TMenuMapper, TMenu> implements TMenuService {

    @Resource
    private TMenuMapper tMenuMapper;

    @Override
    public List<TMenu> queryTMenuByAdminId(Integer id) {
        return tMenuMapper.queryTMenuByAdminId(id);
    }

    @Override
    public List<TMenu> tMenuTypeQuery() {
        return tMenuMapper.tMenuTypeQuery();
    }

    /*
    菜单管理
     */
    @Override
    public List<TMenu> tMenuListQuery() {
        return tMenuMapper.tMenuListQuery();
    }

    @Override
    public List<TMenu> queryAll(String name) {
        return tMenuMapper.queryAll(name);
    }

    @Override
    public int deleteTMenu(Integer id) {
        return tMenuMapper.deleteById(id);
    }

    @Override
    public int insertTMenu(TMenu tMenu) {
        return tMenuMapper.insert(tMenu);
    }

    @Override
    public int updateTMenu(TMenu tMenu) {
        return tMenuMapper.updateById(tMenu);
    }
}
